package cn.myschool.web.filter;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
@WebListener
public class SchoolSessionCreate implements HttpSessionListener {
    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        System.out.println("session "+httpSessionEvent.getSession().getId()+"创建于 "+new Date());
       }

    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        System.out.println("session "+httpSessionEvent.getSession().getId()+"销毁于 "+new Date());

    }
}
